package net.noday.persistent.jdbcImpl.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import net.noday.domain.User;
import net.noday.domain.mapping.UserMapping;

import org.springframework.jdbc.core.RowMapper;

public final class UserMapper implements RowMapper<User> {

	@Override
	public User mapRow(ResultSet rs, int rowNum) throws SQLException {
		User user = new User(rs.getLong(UserMapping.UID), 
				rs.getString(UserMapping.EMAIL), 
				rs.getString(UserMapping.PASSWORD), 
				rs.getString(UserMapping.NICKNAME), 
				rs.getString(UserMapping.HOMEPAGE), 
				rs.getString(UserMapping.ADDRESS), 
				rs.getInt(UserMapping.EXPERIENCE), 
				rs.getString(UserMapping.USERGROUP), 
				rs.getString(UserMapping.CREATEDATE), 
				rs.getString(UserMapping.CREATEIP), 
				rs.getBoolean(UserMapping.ACTIVE), 
				rs.getString(UserMapping.LASTLOGINTIME), 
				rs.getString(UserMapping.LASTLOGINIP), 
				rs.getString(UserMapping.UUID), 
				rs.getString(UserMapping.UUIDVALID), 
				rs.getString(UserMapping.DESCRIPTION));
		return user;
	}
	
}
